
app.controller('PDFCtrl', function($element, $scope, $state, rest, user, uploadConf, tipService, $window, $rootScope,uploadprefix,decoJavaUrlLsf,$timeout) {
	$scope.iNowData = angular.copy($scope.ngDialogData, {});
	
	//console.log($scope.iNowData.contractPDF); //PDF路径
	//$scope.src = "js/module/decorate/contractPDF.pdf";
	
	var _index = "";
	if($scope.iNowData.contractPDF.indexOf('.jpg') != -1){
		_index = $scope.iNowData.contractPDF.indexOf('.jpg');
	} else if($scope.iNowData.contractPDF.indexOf('.png') != -1){
		_index = $scope.iNowData.contractPDF.indexOf('.png');
	} else if($scope.iNowData.contractPDF.indexOf('.pdf') != -1){
		_index = $scope.iNowData.contractPDF.indexOf('.pdf');
	} else if($scope.iNowData.contractPDF.indexOf('.jpeg') != -1){
		_index = $scope.iNowData.contractPDF.indexOf('.jpeg');
	}

    var pdfPath = $scope.iNowData.contractPDF.substring(0,_index)
    // console.log(_index)
    // console.log(pdfPath)


    $timeout(function(){
    	//$("a.media").attr('href',uploadprefix + $scope.iNowData.contractPDF).media({width:1100, height:600});
    	$("#lookPDF").attr('src',uploadprefix + pdfPath).css({
    		width: '100%'
    	});
    },20)
    
});
